package com.zfei.gfb.api.domain;

import java.io.Serializable;
import java.util.Objects;

/**
 * 用户
 *
 * @author fgh
 */
public class User implements Serializable {

    /**
     * uid
     */
    private String uid;

    /**
     * 易信号
     */
    private String yid;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 昵称
     */
    private String nick;

    /**
     * 头像
     */
    private String icon;

    /**
     * 性别
     */
    private Byte sex;

    /**
     * 背景图
     */
    private String bkImage;

    /**
     * 开关
     */
    private Long bits;

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getYid() {
        return yid;
    }

    public void setYid(String yid) {
        this.yid = yid;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Byte getSex() {
        return sex;
    }

    public void setSex(Byte sex) {
        this.sex = sex;
    }

    public String getBkImage() {
        return bkImage;
    }

    public void setBkImage(String bkImage) {
        this.bkImage = bkImage;
    }

    public Long getBits() {
        return bits;
    }

    public void setBits(Long bits) {
        this.bits = bits;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(uid, user.uid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid);
    }

    public boolean isConfigValid(Long mask) {
        return this.bits != null && (bits & mask) == mask;
    }

    public static final String GUEST = "GUEST";

    public static final String SYSTEM = "0";

    public static final Long CANNOT_SEE_TALK_POST = 1L << 23; // 是否出现说吧图片主贴，0：默认开启 1：关闭
}
